<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    
</head>
<body>

    <div id="app"></div>
    <script src="vue.js"></script>
    <script>


// v-bind is single direction stream,V-bind是单向数据流，即视图层不改变数据
//V-model是双向数据流
        new Vue(
            {
                el:'#app',
                template:`
                <div>
                    <input  v-bind:value='binding' :class='binding'>{{binding}}</br>
                    <input  v-model:value='binding' :class='binding'>{{binding}}</br>

                    <button v-on:click='change'>click me then change binding value</button>
                </div>
                `,
                data:function(){
                    return {
                        binding:"single directrion"
                    }
                },
                methods:{
                    change:function(){
                        return this.binding="i changed binding"
                    }
                }

            }
        )

    </script>
</body>
</html>